import Router from "vue-router";
import Vue from "vue";
const EditMain = () => import("../edit-containers/EditMain")
const RealHome = () => import("../edit-containers/EditHome2/index.vue");
const EditHome = () => import("../edit-containers/EditHome2/edit.vue");
const StyleHome = () => import("../edit-containers/EditHome2/style.vue");
const EditIndex = () => import('../edit-containers/EditIndex');
const RealActivities = () => import("../edit-containers/Activities2/index.vue");
const EditActivities = () => import("../edit-containers/Activities2/edit.vue");
const StyleActivities = () => import("../edit-containers/Activities2/style.vue");

const RealGiftBuyDec = () => import("../edit-containers/GiftBuyDec/index.vue");
const EditGiftBuyDec = () => import("../edit-containers/GiftBuyDec/edit.vue");
const StyleGiftBuyDec = () => import("../edit-containers/GiftBuyDec/style.vue");

const RealPointMallDec = () => import("../edit-containers/PointMallDec/index.vue");
const EditPointMallDec = () => import("../edit-containers/PointMallDec/edit.vue");
const StylePointMallDec = () => import("../edit-containers/PointMallDec/style.vue");

const EditSettings = () => import("../edit-containers/EditSettings");
const MiddleWare = () => import("../real-containers/MiddleWare/index.vue");
import mergeRouter from "../utils/settings/mergeRouter";
Vue.use(Router);
// let RouterArray = 
// console.log("打印mg页面的路由结构", RouterArray)
export default () => {
    return new Router({
        routes: [
            {
                path: '/',
                redirect: {name: "index"}
            },
            {
                path: "/index",
                name: "index",
                title: "后台首页",
                component: EditIndex
            },
            {
                path: "/settings",
                name: "settings",
                title: "后台设置",
                component: EditSettings
            },
            {
                path: "/EditMain",
                name: "EditMain",
                component: EditMain,
                children: [
                    {
                        path: "home",
                        name: `home`,
                        components: {
                            style: StyleHome,
                            real: RealHome,
                            edit: EditHome
                        }
                    },
                    {
                        path: "buyGiftCard",
                        name: `buyGiftCard`,
                        title: "礼品卡购买模板",
                        components: {
                            style: StyleGiftBuyDec,
                            real: RealGiftBuyDec,
                            edit: EditGiftBuyDec
                        }
                    },
                    {
                        path: "IntegralBuy",
                        name: `IntegralBuy`,
                        title: "积分商城模板",
                        components: {
                            style: StylePointMallDec,
                            real: RealPointMallDec,
                            edit: EditPointMallDec
                        }
                    },
                    {
                        path: "NewThematicActivities",
                        name: `NewThematicActivities`,
                        title: "专题活动模板",
                        components: {
                            style: StyleActivities,
                            real: RealActivities,
                            edit: EditActivities
                        }
                    },
                    {
                        path: "middleware",
                        name: "middleware",
                        components: {
                            real: MiddleWare
                        }
                    },
                    ...mergeRouter()
                ]
            },
            
        ]
    });
};